<template>
  <div class="venus-list-page">
    <!--签约查询界面-->
    <div class="page-search">

      <el-form label-width="160px" style="margin: 20px 50px 20px 0px;" size="mini">
        <el-row type="flex" class="list-items">
          <el-col :span="8">
            <el-form-item label="基金代码:">
              <el-input v-model="table.fund_table.fund_code" class="venus-input-middle" placeholder="请输入基金代码" />
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="基金名称:">
              <el-input v-model="table.fund_table.fund_name" class="venus-input-middle" placeholder="请输入基金名称" />
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="基金类型:">
              <el-select v-model="table.fund_table.fund_type" class="venus-input-middle" placeholder="--请选择--">
                <el-option v-for="(value,key,index) in dict.fundType" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <div class="venus-btn-box" style="text-align: center;">
            <el-button type="success" @click="search">查询</el-button>
            <el-button type="info" plain @click="resetForm">重置</el-button>
            <el-button type="success" @click="addBean">新增</el-button>
          </div>
        </el-row>
      </el-form>
    </div>
    <!--    查询列表返显-->
    <div class="page-list">
      <el-row type="flex" justify="space-between" class="page-list-head">
        <div class="title">查询结果</div>
      </el-row>
      <table-pagination :table-data="table.fund_table.tableData" :table-header-config="table.tableHeaderConfig"
        highlight-current-row :total="table.fund_table.total" :page-size="table.fund_table.limit" :now-page="table.fund_table.nowPage"
        :operation-config="table.operationConfig" @current-change="handleCurrentChange" />
    </div>

    <!-- 新增信息模态框 -->
    <el-dialog :title="form.addForm.title" :visible.sync="form.addForm.dialogFormVisible" v-dialogDrag>
      <el-form :model="form.fund_form" size="mini" :rules="form.rules" ref="addForm">
        <el-input type="hidden" v-model="form.fund_form.fund_detail" />
        <el-input type="hidden" v-model="form.fund_form.t8_fund_info_id" />
        <el-row type="flex">
          <el-col>
            <el-form-item label="市场:" :label-width="style.formLabelWidth" prop="market">
              <el-select v-model="form.fund_form.market" placeholder="请选择">
                <el-option v-for="(value,key) in dict.market" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="核算方式:" :label-width="style.formLabelWidth" prop="acct_mod">
              <el-select v-model="form.fund_form.acct_mod" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.acctMod" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金代码:" :label-width="style.formLabelWidth" prop="fund_code">
              <el-input v-model="form.fund_form.fund_code" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="基金名称:" :label-width="style.formLabelWidth" prop="fund_name">
              <el-input v-model="form.fund_form.fund_name" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金类型:" :label-width="style.formLabelWidth" prop="fund_type">
              <el-select v-model="form.fund_form.fund_type" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.addForm_fundType" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="托管人:" :label-width="style.formLabelWidth" prop="trustee">
              <el-input v-model="form.fund_form.trustee" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="发行份额(亿元):" :label-width="style.formLabelWidth" prop="faceamount">
              <el-input v-model="form.fund_form.faceamount" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="发行基金公司:" :label-width="style.formLabelWidth" prop="fund_comp">
              <el-input v-model="form.fund_form.fund_comp" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金成立日期:" :label-width="style.formLabelWidth" prop="establish_date">
              <el-date-picker v-model="form.fund_form.establish_date" value-format="yyyyMMdd" type="date" placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="运作方式:" :label-width="style.formLabelWidth" prop="runways">
              <el-select v-model="form.fund_form.runways" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.runWay" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="行业:" :label-width="style.formLabelWidth" prop="industry">
              <el-select v-model="form.fund_form.industry" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.industry" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="基金投资资产:" :label-width="style.formLabelWidth" prop="fun_invest_asset">
              <el-input v-model="form.fund_form.fun_invest_asset" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="人行分类:" :label-width="style.formLabelWidth" prop="bc_fund_type">
              <el-select v-model="form.fund_form.bc_fund_type" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.bcFundTyoe" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="增信方式:" :label-width="style.formLabelWidth" prop="add_credit">
              <el-input v-model="form.fund_form.add_credit" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="计划发行量(亿元):" :label-width="style.formLabelWidth" prop="planned_circulation">
              <el-input v-model="form.fund_form.planned_circulation" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="资金用途:" :label-width="style.formLabelWidth" prop="fund_purpose">
              <el-input v-model="form.fund_form.fund_purpose" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="详细还款来源:" :label-width="style.formLabelWidth" prop="detail_source">
              <el-input v-model="form.fund_form.detail_source" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="自营型/公益型:" :label-width="style.formLabelWidth" prop="self_operated">
              <el-select v-model="form.fund_form.self_operated" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.selfOperated" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="行内资产分类:" :label-width="style.formLabelWidth" prop="bank_fund_sortbank_fund_sort">
              <el-select v-model="form.fund_form.bank_fund_sort" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.bankFund" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="审批额度(元):" :label-width="style.formLabelWidth" prop="approval_amount">
              <el-input v-model="form.fund_form.approval_amount" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="理审会决议号:" :label-width="style.formLabelWidth" prop="trial_resolution_no">
              <el-input v-model="form.fund_form.trial_resolution_no" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="理审会决议附加条件:" :label-width="style.formLabelWidth" prop="trial_resolution_condition">
              <el-input v-model="form.fund_form.trial_resolution_condition" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="投资经理:" :label-width="style.formLabelWidth" prop="investment_manager">
              <el-input v-model="form.fund_form.investment_manager" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="经办行:" :label-width="style.formLabelWidth" prop="managing_bank">
              <el-input v-model="form.fund_form.managing_bank" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="经办负责人:" :label-width="style.formLabelWidth" prop="managing_person">
              <el-input v-model="form.fund_form.managing_person" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="经办联系方式:" :label-width="style.formLabelWidth" prop="managing_phone">
              <el-input v-model="form.fund_form.managing_phone" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="投后管理人:" :label-width="style.formLabelWidth" prop="post_after_manager">
              <el-input v-model="form.fund_form.post_after_manager" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="最后一次现场检查时间:" :label-width="style.formLabelWidth" prop="last_site_inspect_time">
              <el-date-picker v-model="form.fund_form.last_site_inspect_time" value-format="yyyyMMdd" type="date"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="最近一次现场检查人:" :label-width="style.formLabelWidth" prop="last_site_inspect_person">
              <el-input v-model="form.fund_form.last_site_inspect_person" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="最近一次非现场检查时间:" :label-width="style.formLabelWidth" prop="last_offsite_inspect_time">
              <el-date-picker v-model="form.fund_form.last_offsite_inspect_time" value-format="yyyyMMdd" type="date"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="最近一次非现场检查人:" :label-width="style.formLabelWidth" prop="last_offsite_inspect_person">
              <el-input v-model="form.fund_form.last_offsite_inspect_person" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="档案号" :label-width="style.formLabelWidth" prop="file_number">
              <el-input v-model="form.fund_form.file_number" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="备注:" :label-width="style.formLabelWidth" prop="remark">
              <el-input v-model="form.fund_form.remark" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="资产介绍人:" :label-width="style.formLabelWidth" prop="asset_introductor">
              <el-input v-model="form.fund_form.asset_introductor" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="币种:" :label-width="style.formLabelWidth" prop="currency_type">
              <el-select v-model="form.fund_form.currency_type" placeholder="请选择" filterable clearable>
                <el-option v-for="item in dict.currency" :label="item.money_name" :value="item.money_code" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align: center;">
        <el-button type="success" @click="addOk('addForm')">确 定</el-button>
        <el-button type="info" @click="form.addForm.dialogFormVisible=false">关闭</el-button>
      </div>
    </el-dialog>

    <!-- 修改基金信息模态框 -->
    <el-dialog :title="form.editForm.title" :visible.sync="form.editForm.dialogFormVisible" v-dialogDrag>
      <el-form :model="form.fund_form" size="mini" :rules="form.rules" ref="editForm">
        <el-input type="hidden" v-model="form.fund_form.fund_detail" />
        <el-input type="hidden" v-model="form.fund_form.t8_fund_info_id" />
        <el-row type="flex">
          <el-col>
            <el-form-item label="市场:" :label-width="style.formLabelWidth" prop="market">
              <el-select v-model="form.fund_form.market" placeholder="请选择" disabled>
                <el-option v-for="(value,key) in dict.market" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="核算方式:" :label-width="style.formLabelWidth" prop="acct_mod">
              <el-select v-model="form.fund_form.acct_mod" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.acctMod" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金代码:" :label-width="style.formLabelWidth" prop="fund_code">
              <el-input v-model="form.fund_form.fund_code" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="基金名称:" :label-width="style.formLabelWidth" prop="fund_name">
              <el-input v-model="form.fund_form.fund_name" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金类型:" :label-width="style.formLabelWidth" prop="fund_type">
              <el-select v-model="form.fund_form.fund_type" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.addForm_fundType" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="托管人:" :label-width="style.formLabelWidth" prop="trustee">
              <el-input v-model="form.fund_form.trustee" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="发行份额(亿元):" :label-width="style.formLabelWidth" prop="faceamount">
              <el-input v-model="form.fund_form.faceamount" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="发行基金公司:" :label-width="style.formLabelWidth" prop="fund_comp">
              <el-input v-model="form.fund_form.fund_comp" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金成立日期:" :label-width="style.formLabelWidth" prop="establish_date">
              <el-date-picker v-model="form.fund_form.establish_date" value-format="yyyyMMdd" type="date" placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="运作方式:" :label-width="style.formLabelWidth" prop="runways">
              <el-select v-model="form.fund_form.runways" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.runWay" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="行业:" :label-width="style.formLabelWidth" prop="industry">
              <el-select v-model="form.fund_form.industry" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.industry" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="基金投资资产:" :label-width="style.formLabelWidth" prop="fun_invest_asset">
              <el-input v-model="form.fund_form.fun_invest_asset" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="人行分类:" :label-width="style.formLabelWidth" prop="bc_fund_type">
              <el-select v-model="form.fund_form.bc_fund_type" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.bcFundTyoe" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="增信方式:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.add_credit" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="计划发行量(亿元):" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.planned_circulation" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="资金用途:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.fund_purpose" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="详细还款来源:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.detail_source" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="自营型/公益型:" :label-width="style.formLabelWidth">
              <el-select v-model="form.fund_form.self_operated" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.selfOperated" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="行内资产分类:" :label-width="style.formLabelWidth">
              <el-select v-model="form.fund_form.bank_fund_sort" placeholder="请选择" filterable clearable>
                <el-option v-for="(value,key,index) in dict.bankFund" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="审批额度(元):" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.approval_amount" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="理审会决议号:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.trial_resolution_no" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="理审会决议附加条件:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.trial_resolution_condition" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="投资经理:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.investment_manager" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="经办行:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.managing_bank" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="经办负责人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.managing_person" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="经办联系方式:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.managing_phone" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="投后管理人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.post_after_manager" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="最后一次现场检查时间:" :label-width="style.formLabelWidth">
              <el-date-picker v-model="form.fund_form.last_site_inspect_time" value-format="yyyyMMdd" type="date"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="最近一次现场检查人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.last_site_inspect_person" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="最近一次非现场检查时间:" :label-width="style.formLabelWidth">
              <el-date-picker v-model="form.fund_form.last_offsite_inspect_time" value-format="yyyyMMdd" type="date"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="最近一次非现场检查人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.last_offsite_inspect_person" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="档案号" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.file_number" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="备注:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.remark" />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="资产介绍人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.asset_introductor" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="币种:" :label-width="style.formLabelWidth">
              <el-select v-model="form.fund_form.currency_type" placeholder="请选择" filterable clearable>
                <el-option v-for="item in dict.currency" :label="item.money_name" :value="item.money_code" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align: center;">
        <el-button type="success" @click="editOk('editForm')">确 定</el-button>
        <el-button type="info" @click="form.editForm.dialogFormVisible = false">关闭</el-button>
      </div>
    </el-dialog>

    <!-- 详情模态框 -->
    <el-dialog :title="form.detailForm.title" :visible.sync="form.detailForm.dialogFormVisible" v-dialogDrag>
      <el-form :model="form.fund_form" size="mini" :rules="form.rules" ref="detailForm">
        <el-input type="hidden" v-model="form.fund_form.fund_detail" />
        <el-input type="hidden" v-model="form.fund_form.t8_fund_info_id" />
        <el-row type="flex">
          <el-col>
            <el-form-item label="市场:" :label-width="style.formLabelWidth" prop="market">
              <el-select v-model="form.fund_form.market" placeholder="请选择" disabled>
                <el-option v-for="(value,key) in dict.market" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="核算方式:" :label-width="style.formLabelWidth" prop="acct_mod">
              <el-select v-model="form.fund_form.acct_mod" placeholder="请选择" filterable clearable disabled>
                <el-option v-for="(value,key,index) in dict.acctMod" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金代码:" :label-width="style.formLabelWidth" prop="fund_code">
              <el-input v-model="form.fund_form.fund_code" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="基金名称:" :label-width="style.formLabelWidth" prop="fund_name">
              <el-input v-model="form.fund_form.fund_name" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金类型:" :label-width="style.formLabelWidth" prop="fund_type">
              <el-select v-model="form.fund_form.fund_type" placeholder="请选择" filterable clearable disabled>
                <el-option v-for="(value,key,index) in dict.addForm_fundType" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="托管人:" :label-width="style.formLabelWidth" prop="trustee">
              <el-input v-model="form.fund_form.trustee" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="发行份额(亿元):" :label-width="style.formLabelWidth" prop="faceamount">
              <el-input v-model="form.fund_form.faceamount" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="发行基金公司:" :label-width="style.formLabelWidth" prop="fund_comp">
              <el-input v-model="form.fund_form.fund_comp" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="基金成立日期:" :label-width="style.formLabelWidth" prop="establish_date">
              <el-date-picker v-model="form.fund_form.establish_date" value-format="yyyyMMdd" type="date" placeholder="选择日期"
                disabled>
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="运作方式:" :label-width="style.formLabelWidth" prop="runways">
              <el-select v-model="form.fund_form.runways" placeholder="请选择" filterable clearable disabled>
                <el-option v-for="(value,key,index) in dict.runWay" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="行业:" :label-width="style.formLabelWidth" prop="industry">
              <el-select v-model="form.fund_form.industry" placeholder="请选择" filterable clearable disabled>
                <el-option v-for="(value,key,index) in dict.industry" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="基金投资资产:" :label-width="style.formLabelWidth" prop="fun_invest_asset">
              <el-input v-model="form.fund_form.fun_invest_asset" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="人行分类:" :label-width="style.formLabelWidth" prop="bc_fund_type">
              <el-select v-model="form.fund_form.bc_fund_type" placeholder="请选择" filterable clearable disabled>
                <el-option v-for="(value,key,index) in dict.bcFundTyoe" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="增信方式:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.add_credit" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="计划发行量(亿元):" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.planned_circulation" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="资金用途:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.fund_purpose" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="详细还款来源:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.detail_source" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="自营型/公益型:" :label-width="style.formLabelWidth">
              <el-select v-model="form.fund_form.self_operated" placeholder="请选择" filterable clearable disabled>
                <el-option v-for="(value,key,index) in dict.selfOperated" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="行内资产分类:" :label-width="style.formLabelWidth">
              <el-select v-model="form.fund_form.bank_fund_sort" placeholder="请选择" filterable clearable disabled>
                <el-option v-for="(value,key,index) in dict.bankFund" :key="index" :label="value" :value="key" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="审批额度(元):" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.approval_amount" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="理审会决议号:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.trial_resolution_no" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="理审会决议附加条件:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.trial_resolution_condition" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="投资经理:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.investment_manager" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="经办行:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.managing_bank" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="经办负责人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.managing_person" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="经办联系方式:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.managing_phone" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="投后管理人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.post_after_manager" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="最后一次现场检查时间:" :label-width="style.formLabelWidth">
              <el-date-picker v-model="form.fund_form.last_site_inspect_time" value-format="yyyyMMdd" type="date"
                placeholder="选择日期" disabled>
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="最近一次现场检查人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.last_site_inspect_person" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="最近一次非现场检查时间:" :label-width="style.formLabelWidth">
              <el-date-picker v-model="form.fund_form.last_offsite_inspect_time" value-format="yyyyMMdd" type="date"
                placeholder="选择日期" disabled>
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="最近一次非现场检查人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.last_offsite_inspect_person" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="档案号" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.file_number" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col>
            <el-form-item label="备注:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.remark" disabled />
            </el-form-item>
          </el-col>
          <el-col>
            <el-form-item label="资产介绍人:" :label-width="style.formLabelWidth">
              <el-input v-model="form.fund_form.asset_introductor" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col>
            <el-form-item label="币种:" :label-width="style.formLabelWidth">
              <el-select v-model="form.fund_form.currency_type" placeholder="请选择" filterable clearable disabled>
                <el-option v-for="item in dict.currency" :label="item.money_name" :value="item.money_code" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align: center;">
        <el-button type="info" @click="form.detailForm.dialogFormVisible = false">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  /* 自定义数据加载 */
  import request from '@/utils/request'
  import * as kk from '@/utils/k-utils'
  import '@/utils/directives'

  export default {
    name: 'BondInfo',
    data() {
      return {
        /* 数据字典*/
        dict: {
          fundType: [],
          addForm_fundType: [],
          market: [],
          acctMod: [],
          runWay: [],
          industry: [],
          bcFundTyoe: [],
          selfOperated: [],
          bankFund: [],
          currency: []
        },
        /* 表格*/
        table: {
          operationConfig: { // 表格操作配置
            fixed: 'left',
            width: 200,
            operationButton: [{
                value: '修改',
                func: this.myModify
              },
              {
                value: '删除',
                func: this.myDelete
              },
              {
                value: '详情',
                func: this.myDetail
              }
            ]

          },
          tableHeaderConfig: [ // 表头配置
            {
              prop: 'market',
              label: '市场'
            },
            {
              prop: 'acct_mod',
              label: '核算类型'
            },
            {
              prop: 'fund_code',
              label: '基金代码'
            },
            {
              prop: 'fund_name',
              label: '基金名称'
            },
            {
              prop: 'fund_type',
              label: '基金类型'
            },
            {
              prop: 'runways',
              label: '运作方式'
            },
            {
              prop: 'faceamount',
              label: '发放份额(亿份)(元)'
            },
            {
              prop: 'establish_date',
              label: '成立日期'
            }

          ],
          fund_table: {
            limit: 5,
            total: 0,
            nowPage: 0,
            tableData: [], // 表格数据
            exeid: 'M8207EQ001',
            //查询参数
            fund_code: '',
            fund_name: '',
            fund_type: ''
          }
        },
        form: {
          addForm: {
            title: '新增基金信息管理',
            dialogFormVisible: false
          },
          editForm: {
            title: '修改基金信息管理',
            dialogFormVisible: false
          },
          detailForm: {
            title: '详情',
            dialogFormVisible: false
          },
          fund_form: {
            t8_fund_info_id: '',
            fund_detail: '',
            market: '',
            acct_mod: '',
            fund_code: '',
            fund_name: '',
            fund_type: '',
            trustee: '',
            faceamount: '',
            fund_comp: '',
            establish_date: '',
            runways: '',
            industry: '',
            fun_invest_asset: '',
            bc_fund_type: '',
            add_credit: '',
            planned_circulation: '',
            fund_purpose: '',
            detail_source: '',
            self_operated: '',
            bank_fund_sort: '',
            approval_amount: '',
            trial_resolution_no: '',
            trial_resolution_condition: '',
            investment_manager: '',
            managing_bank: '',
            managing_person: '',
            managing_phone: '',
            post_after_manager: '',
            last_site_inspect_time: '',
            last_site_inspect_person: '',
            last_offsite_inspect_time: '',
            last_offsite_inspect_person: '',
            file_number: '',
            remark: '',
            asset_introductor: '',
            currency_type: '',
          },
          rules: {
            market: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            fund_code: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            fund_name: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            fund_type: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            acct_mod: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            trustee: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            faceamount: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            fund_comp: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            establish_date: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            runways: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            industry: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            fun_invest_asset: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }],
            bc_fund_type: [{
              required: true,
              message: '该项不允许为空',
              trigger: 'blur'
            }]
          }
        },
        style: {
          formLabelWidth: '140px'
        }

      }
    },
    mounted() {
      // 初始化调用
      this.init()
    },
    methods: {
      init: function() {
        kk.k_load_dict(this, 'fundType', 't8_fund_fkinds')

        /* 加载表格数据*/
        this.table.fund_table.nowPage = 1
        kk.k_load_table(this, 'fund_table', 'fund')
      },
      myModify(item, index) {
        this.loadDict()
        this.copyObj(item, this.form.fund_form)
        this.form.editForm.dialogFormVisible = true
      },
      myDelete(item, index) {
        kk.k_load_exeid('fund', 'M8207EQ002', item).then(rep => {
            if (rep.rows.length > 0) {
              if (rep.rows[0].n != 0) {
                this.$message.error('该基金信息不能被删除！');
              } else {
                //删除
                this.$confirm('确认删除吗?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning'
                }).then(() => {
                  kk.k_update_exeid('fund', 'M8207EU003', item).then(rep => {
                    if (rep.success) {
                   //重新加载表格数据
                   kk.k_load_table(this, 'fund_table', 'fund')
                    }
                  })
              }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              })
            })
          }
        }
      })
  },
  myDetail(item, index) {
      this.copyObj(item, this.form.fund_form)
      this.form.detailForm.dialogFormVisible = true
    },
    addBean() {
      //清空表单内容
     /* this.$nextTick(() => {
        this.$refs['addForm'].resetFields();
      }) */
      this.form.addForm.dialogFormVisible = true
      this.loadDict()
    },
    /* 加载模态框的数据字典*/
    loadDict() {
      //加载市场选项
      kk.k_load_dict(this, 'market', 't8_market_place')
      //加载基金类型
      kk.k_load_dict(this, 'addForm_fundType', 't8_fund_fkinds')
      //加载核算方式
      kk.k_load_dict(this, 'acctMod', 't8_busi_account_type')
      //加载运作方式
      kk.k_load_dict(this, 'runWay', 't8_run_ways')
      //加载行业
      kk.k_load_dict(this, 'industry', 't8_zhz_trade_type')
      //加载人行分类
      kk.k_load_dict(this, 'bcFundTyoe', 't8_bc_fund_type')
      //加载行内资产分类
      kk.k_load_dict(this, 'bankFund', 't8_in_asset_class')
      //加载自营型/公益行
      kk.k_load_dict(this, 'selfOperated', 't8_private_public')
      kk.k_load_exeid('public', 'selectCurrency', {}).then(rep => {
        this.dict.currency = rep.rows
      })
    },
    search() {
      this.table.fund_table.nowPage = 1
      kk.k_load_table(this, 'fund_table', 'fund')
    },
    resetForm: function() {
      this.table.fund_table.fund_code = ''
      this.table.fund_table.fund_name = ''
      this.table.fund_table.fund_type = ''
    },
    handleCurrentChange(val) {
      this.table.fund_table.nowPage = val;
      kk.k_load_table(this, 'fund_table', 'fund')

    },
    copyObj(obj1, obj2) {
      for (var key in obj1) {
        // 原型对象不拷贝
        if (key === '__proto__') {
          continue
        }
        // 不存在的属性不拷贝
        if (!obj2.hasOwnProperty(key)) {
          continue
        }
        // 自动将number转换成string
        if (typeof obj1[key] === 'number') {
          obj1[key] = '' + obj1[key]
        }
        obj2[key] = obj1[key]
      }
    },
    addOk(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          //新增
          kk.k_update_exeid('fund', 'M8207EU001', this.form.fund_form).then(rep => {
            if (rep.success) {
              this.form.addForm.dialogFormVisible = false
            }
            //重新加载表格数据
            kk.k_load_table(this, 'fund_table', 'fund')
          })

        } else {
          console.log('error submit!!');
          return false;
        }
      })
    },
    editOk(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          //修改基金信息
          kk.k_update_exeid('fund', 'M8207EU002', this.form.fund_form).then(rep => {
            if (rep.success) {
              this.form.editForm.dialogFormVisible = false
            }
            //重新加载表格数据
            kk.k_load_table(this, 'fund_table', 'fund')
          })

        } else {
          console.log('error submit!!');
          return false;
        }
      })
    }

  }
  }
</script>

<style scoped>
  /*让文本可以被选中*/
  .venus-list-page {
    -moz-user-select: text;
    /*火狐*/
    -webkit-user-select: text;
    /*webkit浏览器*/
    -ms-user-select: text;
    /*IE10*/
    -khtml-user-select: text;
    /*早期浏览器*/
    user-select: text;
  }
</style>
